package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.FunctionSpecification;
import com.yanmaohu.yulia.bean.MethodSpecificationDesignator;
import com.yanmaohu.yulia.bean.RoutineBody;
import com.yanmaohu.yulia.bean.SchemaRoutine;

/**
 * @author Bright Lee
 */
public final class SchemaFunction implements SchemaRoutine, Statement {

    private int beginIndex;
    private int endIndex;
    private FunctionSpecification functionSpecification;
    private MethodSpecificationDesignator methodSpecificationDesignator;
    private RoutineBody routineBody;

    public SchemaFunction(int beginIndex,
                          FunctionSpecification functionSpecification,
                          MethodSpecificationDesignator methodSpecificationDesignator,
                          RoutineBody routineBody) {
        this.beginIndex = beginIndex;
        this.endIndex = routineBody.getEndIndex();
        this.functionSpecification = functionSpecification;
        this.methodSpecificationDesignator = methodSpecificationDesignator;
        this.routineBody = routineBody;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public FunctionSpecification getFunctionSpecification() {
        return functionSpecification;
    }

    public MethodSpecificationDesignator getMethodSpecificationDesignator() {
        return methodSpecificationDesignator;
    }

    public RoutineBody getRoutineBody() {
        return routineBody;
    }

}
